def str_reverse(s):
    """
    字符串完成反转
    :param s: 被反转的字符串
    :return: 反转后的字符串
    """
    return s[::-1]


def substr(s, x, y):
    """
    按照给定的下标完成字符串的切片
    :param s: 待切片的字符串
    :param x: 切片开始的下标
    :param y: 切片结束的下标
    :return: 切片完成后的字符串
    """
    return s[x:y]


if __name__ == '__main__':
    print(str_reverse("wenxiaojian nihao a"))
    print(substr("wenxiaojian love hanlei", 1, 3))
